]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
brightnessManager: Clean up initialization of BrightnessScale
authorSebastian Wick <sebastian.wick@redhat.com>
Tue, 5 Aug 2025 08:31:51 +0000 (10:31 +0200)
committerMarge Bot <marge-bot@gnome.org>
Thu, 7 Aug 2025 21:57:54 +0000 (21:57 +0000)
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3826>

js/misc/brightnessManager.js

index 4ca1752d095c8c02d9ea975d543cdd5f3f556f8e..082487a64847e10319b4eb7a19731460ea2d5934 100644 (file)
@@ -273,13 +273,12 @@ export const BrightnessScale = GObject.registerClass({
             false),
     },
 }, class BrightnessScale extends GObject.Object {
-    constructor(name, value) {
-        super({
-            value,
-            locked: false,
-        });
+    constructor(name, value = 1.0) {
+        super();
 
         this._name = name;
+        this._value = value;
+        this._locked = false;
     }
 
     get name() {
@@ -334,7 +333,7 @@ const MonitorBrightnessScale = GObject.registerClass({
         'backlights-changed': {},
     },
 }, class MonitorBrightnessScale extends BrightnessScale {
-    constructor(monitor, value) {
+    constructor(monitor, value = 1.0) {
         const name = monitor.get_monitors()[0].get_display_name();
 
         super(name, value);